package com.btm.dorisinfo.mapper;

/**
 * 表结构SQL映射类
 * 维护所有与表结构相关的SQL语句
 *
 * @author btm
 * @since 2024-03-21
 */
public class TableStructureMapper {

    /**
     * 查询表结构的SQL
     * 从information_schema.COLUMNS表中获取指定数据库和表的列信息
     */
    public static final String GET_TABLE_COLUMNS_STRUCTURE = """
            SELECT COLUMN_NAME, COLUMN_TYPE, COLUMN_COMMENT, COLUMN_KEY, IS_NULLABLE, COLUMN_DEFAULT
            FROM INFORMATION_SCHEMA.COLUMNS
            WHERE TABLE_SCHEMA = ? AND TABLE_NAME = ?
            """;

    public static final String GET_TABLE_STRUCTURE = "SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ? AND TABLE_NAME = ?";
} 